﻿

namespace WeChat.Core.MsgCore
{
    public interface WeChatIMsghandler
    {
        /// <summary>
        /// 收到文本消息时执行
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        WeChatResponseMsg OnTextMessage(RecTextMessage msg);

        /// <summary>
        /// 收到图片消息时执行
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        WeChatResponseMsg OnImageMessage(RecImageMessage msg);

        /// <summary>
        /// 收到链接消息时执行
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        WeChatResponseMsg OnLinkMessage(RecLinkMessage msg);

        /// <summary>
        /// 收到地理位置消息时执行
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        WeChatResponseMsg OnLocationMessage(RecLocationMessage msg);

        /// <summary>
        /// 收到事件消息时执行
        /// </summary>
        /// <param name="msg"></param> 
        /// <returns></returns>
        WeChatResponseMsg OnEventMessage(RecEventMessage msg);

/* 
        /// <summary>
        /// 处理消息前执行。可用来重组收到消息等
        /// </summary>
        /// <param name="msg"></param>
        void OnBeforeMessage(ReceiveMessage msg);
*/

        /// <summary>
        /// 处理完消息后执行。可用来处理日志等
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="repMsg"></param>
        void OnAfterMessage(WeChatReceiveMsg msg, WeChatResponseMsg repMsg);
    }
}